package org.cytoscape.myapp.cytoscape_app_v1.internal.model;

import java.util.List;
import java.util.Set;
import java.util.Vector;

import org.cytoscape.application.CyApplicationManager;
import org.cytoscape.group.CyGroup;
import org.cytoscape.model.CyNetwork;
import org.cytoscape.model.CyNode;
import org.cytoscape.myapp.cytoscape_app_v1.internal.metrics.domain.TrustedRelationship;

public class StateCollapsed extends StateCyGroups {

	
	private String name = "Collapsed";
	
	public StateCollapsed(CyApplicationManager applicationManager){
		super(applicationManager);
	}

	public void changeStateGroup(Set<CyGroup> groups) {
		for(CyGroup grupo:groups){
			grupo.expand(applicationManager.getCurrentNetwork());
		}
	}

	public StateCyGroups getNextState() {
		return new StateExpanded(applicationManager);
	}
	
	public List<CyNode> getNodes(){
		CyNetwork network = applicationManager.getCurrentNetwork();
		Set<CyGroup> groups = this.cyGroupManager.getGroupSet(network); 
		List<CyNode> nodes = new Vector<CyNode>();
		for(CyGroup group:groups){
			nodes.add(group.getGroupNode());
		}
		
		return nodes;
	}
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	public List<TrustedRelationship> getListTrustedRelationships() {	
	
		return new Vector<TrustedRelationship>();
		
	}

}
